//
//  CFProgressHUDAnimation.m
//  CFProgressHUD
//
//  Created by 千域互联 on 2018/3/18.
//  Copyright © 2018年 千域互联. All rights reserved.
//

#import "CFProgressHUDAnimation.h"
#import "CFProgressHUD.h"

@interface CFProgressHUD (Private)
- (void)animationDidFinish:(BOOL)presenting;
@end

@interface CFProgressHUDAnimation ()
{
    BOOL _presenting;
}
@property (nonatomic, weak) CFProgressHUD *progressHUD;
@end

@implementation CFProgressHUDAnimation

+ (instancetype)animation
{
    return [[self alloc] init];
}

#pragma mark ----------------- Public methods -----------------
- (void)show
{
    _presenting = YES;
}
- (void)hide
{
    _presenting = NO;
}
- (void)animationFinished
{
    [self.progressHUD animationDidFinish:_presenting];
}

@end
